package com.jf.ai.etl.reader;

import org.springframework.ai.document.Document;
import org.springframework.ai.reader.tika.TikaDocumentReader;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2025-07-20
 * Time:21:57
 */
@Component
public class JfTikaReader {
    private final String rootPath = "classpath:/";

    public List<Document> loadText(String fileName) {
        TikaDocumentReader tikaDocumentReader = new TikaDocumentReader(rootPath + fileName);
        return tikaDocumentReader.read();
    }
}
